<?php

namespace common\models\cms;

use common\models\BaseModel;

class ArticleModel extends BaseModel {

    public $aId;
    public $tag;
    public $content;
    public $dirId;
    public $createdBy;
    public $createdTime;
    public $modifiedBy;
    public $modifiedTime;
    public $status;
    public $pv;
    public $title;
    public $dir;
    public $shareNum;
    public $imageUrl;
    public $fileUrl;
    public $fileName;
    public $sort;
    public $linkUrl;
    public $author;
    public $collect;
    public $abstractMode;
    public $abstract;
    public $firstVisitShow;
    public $periodVisitShow;
    public $periodStartTime;
    public $periodEndTime;

    public $g0PeriodStartTime;
    public $g0PeriodEndTime;
    public $g2PeriodStartTime;
    public $g2PeriodEndTime;

    public $closeTime;
    public $orgGuids;
	public function __construct($config = array()) {
        parent::__construct($config);
	}    
    
    public function rules () {
        return [
            [['title','imageUrl','author','tag'], 'required', 'on' => 'save'],
            [['title'], 'string', 'max' => 50, 'on' => 'save'],
            [['tag'], 'string', 'max' => 32, 'on' => 'save'],
            [['aId','dirId', 'status', 'sort','collect', 'abstractMode', 'firstVisitShow', 'periodVisitShow'], 'integer', 'on' => 'save'],
            [['content', 'dir', 'fileUrl', 'status', 'fileName', 'createdBy', 'linkUrl', 'abstract', 'periodStartTime', 'periodEndTime', 'g2PeriodStartTime', 'g2PeriodEndTime', 'g0PeriodStartTime', 'g0PeriodEndTime', 'closeTime'], 'safe', 'on' => 'save'],
        ];
    }
    
    public function attributeLabels(){
        return [
            "content"=>"文章内容",
            "title"=>"标题",
            "tag"=>"标签",
            "dir"=>"分类",
            "imageUrl"=>"封面图片",
            "fileUrl"=>"附件链接",
            "fileName" => "附件名称",
//            "createdBy"=>"作者",
            "linkUrl"=>"原文链接",
            "author"=>"作者",
            "collect"=>"收藏数",
            'firstVisitShow'=> 'firstVisitShow',
            'periodEndTime' => 'periodEndTime'
        ];
    }
}